const express = require('express')
const app = express()
const path = require('path')
const proxy = require('http-proxy-middleware')
app.use('/api', proxy({
    target: process.env.API_URL,
    secure: false,
    changeOrigin: true,
    pathRewrite: {'^/api': ''}
}))
app.use(express.static(path.join(__dirname, 'dist')))
app.listen(3000, () => {
    console.log('listening on port 3000!')
})
